<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <title>系统管理-部门管理</title>

    <link href="../plugin/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet" />
    <link href="../plugin/bootstrap-table-1.11.1/bootstrap-table.min.css" rel="stylesheet" />
    <link href="../plugin/sweetalert-6.6.2/sweetalert2.min.css" rel="stylesheet" />
    <link href="../plugin/jstree/jstree.min.css" rel="stylesheet">



    <script src="../plugin/jquery-3.2.1/jquery-3.2.1.min.js"></script>
    <script src="../plugin/bootstrap-3.3.7/js/bootstrap.min.js"></script>
    <script src="../plugin/bootstrap-table-1.11.1/bootstrap-table.js"></script>
    <script src="../plugin/bootstrap-table-1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="../plugin/sweetalert-6.6.2/sweetalert2.min.js"></script>
    <script src="../plugin/jquery-3.2.1/jquery.formautofill.min.js"></script>
    <script src="../plugin/soul/utils3.js"></script>
    <script src='../js/base.js'></script>
    <script src="../plugin/jquery-3.2.1/jquery.serializejson.js"></script>
    <script src="../plugin/jstree/jstree.min.js"></script>
</head>

<body>

<script>
    $(function () {
        var resp = AjaxUtil.isLogin();
        if (!resp) return;
        var module = 'department';// 评价模块
        var query = [];
        var toolbar = {
            default: [false, true, true, true],// back;add;edit;remove
            dialog: [50, 2, 9],//对话框参数:模态框宽度(百分比);表单标题宽度;表单输入框宽度
            extra: []
        };
        var formElement = [{
            action: [false, true],
            type: 'hidden', // 表单类型
            name: 'departmentId', // 字段名称
        },{
            action: [true, true],
            type: 'text',
            label: '名称',
            name: 'name',
        },{
            action: [true, true],
            id: 'staffId',
            type: 'select',
            label: '部门负责人',
            name: 'staffId',
            items: 'staffManager/selectItems',
        },{
            action: [true, true],
            id: 'parentId',
            type: 'select',
            label: '父部门名称',
            name: 'parentId',
            items: 'department/selectItem',
        },{
            action: [true, true],
            type: 'text',
            label: '部门联系方式',
            name: 'phone',
        },{
            action: [true, true],
            type: 'text',
            label: '职能说明',
            name: 'description',
        }];

        var bootstrapTable = {
            url: '',
            columns: [{
                radio: true
            },{
                field: 'name',
                title: '部门名称',
                align: 'center',
            },{
                field: 'staffName',
                title: '部门负责人',
                align: 'center',
            },{
                field: 'phone',
                title: '部门联系方式',
                align: 'center',
            },{
                field: 'parentName',
                title: '上级部门',
                align: 'center',
            },{
                field: 'description',
                title: '备注',
                align: 'center',
            },]
        }

        // debugger;
        department = SingleTablePageCreateUtil.createInstance(module, null, toolbar, formElement, bootstrapTable);

        department.onAddModalShowBefore = function () {
            $('#department_modal_add input[name="name"]').val("");
            $('#department_modal_add input[name="phone"]').val("");
            $('#department_modal_add input[name="description"]').val("");
            return true;
        };
    });
</script>
</body>

</html>